#!/usr/bin/env node
const http = require('http');
const html=
`<!DOCCTYPE html>
<html lang="en">
  <head>
      <meta charset="UTF-8">
      <title>login</title>
  </head>
  <body>
    <form action="">
      <label for="">username</label>
      <input type="text" name="username">
      <br>
      <label for="">passward</label>
      <input type="passward" name="passward">
      <br>                                            
      <input type="button" value="login">
      <br>
    </form>
  </body>
</html>`;
                                                                       

http.createServer((req,res)=>{
  if(req.url !== '/'){
    res.statusCode = 404;
    res.setHeader('Content-Type','text/html');
    res.end('<h1>Not Found!</h1>');
    return;
  }
  res.writeHead(200,{
    'Content-Type':'text/html',
    'Content-Length':Buffer.byteLength(html)
  });
    
  res.end(html);
}).listen(8080);
